# 状态码
class RETCODE:
    OK          = '0'
    DBERR       = '4001'
    NODATA      = '4002'
    DATAEXIST   = '4003'
    DATAERR     = '4004'
    SESSIONERR  = '4101'
    LOGINERR    = '4102'
    PARAMERR    = '4103'
    USERERR     = '4104'
    ROLEERR     = '4105'
    PWDERR      = '4106'
    REQERR      = '4201'
    IPERR       = '4202'
    THIRDERR    = '4301'
    IOERR       = '4302'
    SERVERERR   = '4500'
    UNKOWNERR   = '4501'

errmsg = {
    RETCODE.OK : u'成功',
    RETCODE.DBERR : u'数据库查询错误',
    RETCODE.NODATA : u'无数据',
    RETCODE.DATAERR : u'数据错误',
    RETCODE.SESSIONERR : u'用户未登录',
    RETCODE.LOGINERR : u'用户登录失败',
    RETCODE.PARAMERR: u'参数错误',
    RETCODE.USERERR : '用户不存在或未激活',
    RETCODE.ROLEERR : '用户身份错误',
    RETCODE.PWDERR : '密码错误',
    RETCODE.REQERR :'非法请求或请求次数受限',
    RETCODE.IPERR : 'IP受限',
    RETCODE.THIRDERR : '第三方系统错误',
    RETCODE.IOERR : '文件读写错误',
    RETCODE.SERVERERR : '内部错误',
    RETCODE.UNKOWNERR : '未知错误'
}